<template>
  <div>
    <div class="bill_box">
      <div class="item" v-for="(item, index) in patientInprepay">
        <div class="item_cell">
          <div>{{ item.deptCode }}</div>
        </div>
        <div class="item_cell">
          <div>{{ item.state }}</div>
        </div>
        <div class="item_cell" style="font-size: 0.8125rem; color: #a4adbe">
          <div>{{ item.operdate }}</div>
        </div>
        <div class="item_pos">
          <div class="num">¥{{ item.prepayCost }}</div>
          <div class="name">
            {{ item.payWay }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getInpatientInprePay } from "@/api/api";
export default {
  data() {
    return {
      patientInprepay: [],
    };
  },
  created() {
    this.getInpatientInprePay(this.$route.query.inpatientSerialNo);
  },
  methods: {
    getInpatientInprePay(inpatientSerialNo) {
      var data = {
        inpatientSerialNo,
      };
      getInpatientInprePay(data).then((res) => {
        if (res.code == 200) {
          this.patientInprepay = res.data.patientInprepay;
        }
      });
    },
  },
};
</script>
<style  scoped>
.bill_box {
  width: 100%;
  height: calc(100vh - 6rem);
  overflow-y: auto;
  padding-bottom: 2rem;
}
.bill_box .item {
  width: calc(100% - 2rem);
  margin: 0 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e7ecf5;
  background-color: #fff;
  position: relative;
}
.bill_box .item:last-of-type {
  border: none;
}
.bill_box .item .item_cell {
  display: flex;
  align-items: center;
}
.bill_box .item .item_cell > div:nth-of-type(1) {
  line-height: 1.875rem;
}
.item_pos {
  position: absolute;
  top: calc(50% - 1.5rem);
  right: 0;
}
.item_pos > div {
  width: 5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  text-align: right;
}
.item_pos .num {
  color: #f72d23;
  font-size: 1rem;
}
.item_pos .name {
  font-size: 0.875rem;
  color: #a4adbe;
}
</style>